

/*********************************************************************************************
 Project:  How do Masses React to Party Polarization? Limited Effect of Elite Polarization on Mass Polarization
 Date:     November 2024
 Purpose:  Replication 
 Author:   Prepared by Semih Çakır
**********************************************************************************************/

/*
This part is optional. Customize your Stata as you wish depending on the esthetics you want
grstyle clear

grstyle init
grstyle set plain, box
grstyle color background white
grstyle set color gs10%50
grstyle yesno draw_major_hgrid yes
grstyle yesno draw_major_ygrid yes
set scheme s1mono

	clear all
	set more off
	numlabel, add
	
*/	



	
/*******************************************************************************
	 Select sections to run (1 to run 0 otherwise) 
*******************************************************************************/

* You need to select among the following depending on what you want to replicate. But first, run prep1 and prep2 to get the data (data1.dta and panel.dta). Then, for instance, if you only want to replicate Figure 2, you need to select figure2 by putting a "1" next to it. For whatever you do not want to replicate, put a "0", the code will skip those. 

	* Preparation 
	local paths				1 

	* Data coding and construction
	local prep1	 			0 // code the data
	local prep2				0 // code the data for panel analyses
	
	* Replicating the main analyses
	local figure2			0 // Figure 2: Average Perceived Position of Labour Party's according to Respondents
	local table1 			0 // Table 1: Lack of Follow-the-Party and Backlash Effects among Partisans
	local figure3			0 // Figure 3: Lack of Follow-the-Party and Backlash Effects among Partisans
	local figure4			0 // Figure 4: Labour Partisans do not Follow the Party and Conservative Partisans do not Backlash
	local figure5			0 // Figure 5: Previously Right-Wing Labour Partisans Followed the Party's Lead to the Left
	
	*APPENDICES 
	local appendix1			0 // replicate appendix 1: There was no Noticeable Shift in Public Preferences Prior to the Leadership Change
	local appendix2			0 // replicate appendix 2: Who Perceived the Shift in the Labour Party's Position?
	local appendix4			0 // replicate appendix 4: Replications with the Rest of the Electorate as a Reference Category
	local appendix5			0 // replicate appendix 5: Lack of Follow-the-Party and Backlash Effects even Among those Who Perceived the Labour Party's Shif
	local appendix6			0 // replicate appendix 6: Follow-the-Party and Backlash Effects among Conservative Party, Labour Party, Liberal Democrats, and UKIP Identifiers
	local appendix7			0 // replicate appendix 7: Change in Polarization Metrics: Masses did not become more polarized
	local appendix9_1		0 // replicate appendix 9 - Part 1: First 12 waves takers
	local appendix9_2		0 // replicate appendix 9 - Part 2: First 20 waves takers
	local appendix9_3		0 // replicate appendix 9 - Part 3: Descriptives
	local appendix10		0 // replicate appendix 10: Why Could Party Cue Effectiveness Depend on One's Spatial Location on Left-Right?
	local appendix11		0 // replicate appendix 11: Effective Party Cues for Ideologically Out of Sync Partisans: Alternative Operationalization
	local appendix12		0 // replicate appendix 12: Did Strong Labour Partisans Follow the Party?
	local appendix13		0 // replicate appendix 13: Did Those who Consistently Identified with the Labour Party Prior to Party Position Change Adopt more Left-Wing Positions? 	
	local appendix14		0 // replicate appendix 14: Did Those who Continued to Identify with the Labour Party after the Party Position Change Adopt more Left-Wing Positions?
	local appendix15		0 // replicate appendix 15: Testing the Follow-the-Party and Backlash Effects on Various Issues
	local appendix16		0 // replicate appendix 16: Brexit 
	local appendix17		0 // replicate appendix 17: Perception of the Labour Party Being United or Divided does not Explain the Findings 
	local appendix18		0 // replicate appendix 18: Do Feelings towards the Labour Party and Jeremy Corbyn Influence how Masses React to Party Cues?
	local appendix19		1 // replicate appendix 19: Does Age Moderate how Masses React to Left-wing Party Cues from the Labour Party?
	

	if `paths' {
		
	*Set your directory (Do not forget to adjust the location of these folders):

	global directory "~/Dropbox/EJPR/masspolarization"

		* Now we create the following folders inside the folder that you just selected as global directory. Things will be saved in these subfolders: 
			* - create a subfolder called "data": Put the original data set here. In our case the British Election Study Internet Panel original dataset.  When you run "prep1" and "prep2", (data1.dta) and (panel.dta) will also be saved here automatically. 
			* - create a subfolder called "dofiles": all the dofiles are located here
			* - create a subfolder called "tables": this is where the regression results or descriptive stats will be saved
			* - create a subfolder called "figures": all the figures will be saved here.
		
	global data "${directory}/data" // Put the original data set here. In our case the British Election Study Internet Panel original dataset. 
	global dofiles "${directory}/dofiles" // Put all the dofiles here.
	global tables "${directory}/tables"  
	global figures "${directory}/figures" 
	
	}	
		
/*******************************************************************************
	 PREP 1 - Code the data 
*******************************************************************************/

	if `prep1'{
		cd "${dofiles}" 
		do prep1.do 
	}

/*******************************************************************************
	 PREP 2 - Code the data for PANEL analyses
*******************************************************************************/

	if `prep2'{
		cd "${dofiles}" 
		do prep2.do 
	}

	
/*******************************************************************************
	 FIGURE 2
*******************************************************************************/

	if `figure2'{
		cd "${dofiles}" 
		do figure2.do 
	}

	
/*******************************************************************************
	 TABLE 1
*******************************************************************************/

	if `table1'{
		cd "${dofiles}" 
		do table1.do 
	}

	
/*******************************************************************************
	 FIGURE 3
*******************************************************************************/

	if `figure3'{
		cd "${dofiles}" 
		do figure3.do 
	}

		
	
/*******************************************************************************
	 FIGURE 4
*******************************************************************************/

	if `figure4'{
		cd "${dofiles}" 
		do figure4.do 
	}
	
/*******************************************************************************
	 FIGURE 5
*******************************************************************************/

	if `figure5'{
		cd "${dofiles}" 
		do figure5.do 
	}


	
/*******************************************************************************
	 APPENDIX 1
*******************************************************************************/

	if `appendix1'{
		cd "${dofiles}" 
		do appendix1.do 
	}

/*******************************************************************************
	 APPENDIX 2
*******************************************************************************/

	if `appendix2'{
		cd "${dofiles}" 
		do appendix2.do 
	}

	
/*******************************************************************************
	 APPENDIX 4
*******************************************************************************/

	if `appendix4'{
		cd "${dofiles}" 
		do appendix4.do 
	}

/*******************************************************************************
	 APPENDIX 5
*******************************************************************************/

	if `appendix5'{
		cd "${dofiles}" 
		do appendix5.do 
	}

/*******************************************************************************
	 APPENDIX 6
*******************************************************************************/

	if `appendix6'{
		cd "${dofiles}" 
		do appendix6.do 
	}
	
/*******************************************************************************
	 APPENDIX 7
*******************************************************************************/

	if `appendix7'{
		cd "${dofiles}" 
		do appendix7.do 
	}
		
/*******************************************************************************
	 APPENDIX 9 - part 1
*******************************************************************************/

	if `appendix9_1'{
		cd "${dofiles}" 
		do appendix9_1.do 
	}
		
/*******************************************************************************
	 APPENDIX 9 - part 2
*******************************************************************************/

	if `appendix9_2'{
		cd "${dofiles}" 
		do appendix9_2.do 
	}

/*******************************************************************************
	 APPENDIX 9 - part 3
*******************************************************************************/

	if `appendix9_3'{
		cd "${dofiles}" 
		do appendix9_3.do 
	}

/*******************************************************************************
	 APPENDIX 10
*******************************************************************************/

	if `appendix10'{
		cd "${dofiles}" 
		do appendix10.do 
	}
	
	
/*******************************************************************************
	 APPENDIX 11
*******************************************************************************/

	if `appendix11'{
		cd "${dofiles}" 
		do appendix11.do 
	}

/*******************************************************************************
	 APPENDIX 12
*******************************************************************************/

	if `appendix12'{
		cd "${dofiles}" 
		do appendix12.do 
	}
		
/*******************************************************************************
	 APPENDIX 13
*******************************************************************************/

	if `appendix13'{
		cd "${dofiles}" 
		do appendix13.do 
	}
		
/*******************************************************************************
	 APPENDIX 14
*******************************************************************************/

	if `appendix14'{
		cd "${dofiles}" 
		do appendix14.do 
	}
		
/*******************************************************************************
	 APPENDIX 15
*******************************************************************************/

	if `appendix15'{
		cd "${dofiles}" 
		do appendix15.do 
	}
	
/*******************************************************************************
	 APPENDIX 16
*******************************************************************************/

	if `appendix16'{
		cd "${dofiles}" 
		do appendix16.do 
	}
	
/*******************************************************************************
	 APPENDIX 17
*******************************************************************************/

	if `appendix17'{
		cd "${dofiles}" 
		do appendix17.do 
	}
		
/*******************************************************************************
	 APPENDIX 18
*******************************************************************************/

	if `appendix18'{
		cd "${dofiles}" 
		do appendix18.do 
	}
	
/*******************************************************************************
	 APPENDIX 19
*******************************************************************************/

	if `appendix19'{
		cd "${dofiles}" 
		do appendix19.do 
	}
		
			
				
			
		
			
		
				
						
		
		